import  java.util.Scanner;//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
import java.util.ArrayList;
import java.util.Vector;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;

import java.util.Random;
public class Main {
    public static void main(String[] args) {
        //第一题
        System.out.println("第1题");
        int[] arr = new int[10];
        for(int i = 0;i<10;++i) arr[i] = i+1;
        int num = 0;//记录能被3整除的数
        for(int i = 0;i<10;++i)
        {
            if(arr[i]%3 == 0)
                num+=1;
        }
        System.out.println(num);
        //第二题
        System.out.println("第2题");
        int[] stuScore = new int[]{99,85,82,63,60,-1};
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入新增成绩：");
        int score = sc.nextInt();
        for(int i = 0;i<stuScore.length;++i){
            if(stuScore[i]<=score){
                //挪位置
                for(int j = stuScore.length-1;j>i;--j){
                    stuScore[j] = stuScore[j-1];
                }
                stuScore[i] = score;
                break;
            }
        }
        for(int i = 0;i<stuScore.length;++i) System.out.printf("%d ",stuScore[i]);
        System.out.println();
        //第3题
        System.out.println("第3题");
        int people = 0;
        int compute = 0;
        Random rand = new Random();
        String[] game = new String[]{" ","剪刀","石头","布"};
        System.out.println("剪刀石头布开始！！！");
        for(int times = 1;times<=5;++times){
            System.out.printf("第%d局\n",times);
            System.out.println("玩家请输入：（1 2 3分别代表剪刀 石头 布）");
            int peopleInput = sc.nextInt();
            while (peopleInput<1||peopleInput>3){
                System.out.println("输入错误！请重新输入：");
                peopleInput = sc.nextInt();
            }
            System.out.printf("玩家本局出%s\n",game[peopleInput]);
            int computeInput = (Math.abs(rand.nextInt())%3)+1;
            System.out.printf("电脑本局出%s\n",game[computeInput]);
            if(peopleInput == computeInput){
                System.out.println("平局！");
            }
            else if(peopleInput == 1&&computeInput == 3||peopleInput == 2&&computeInput == 1||peopleInput == 3&&computeInput == 2){
                System.out.printf("第%d局玩家获胜！\n",times);
                people+=1;
            }
            else {
                System.out.printf("第%d局电脑获胜！\n",times);
                compute+=1;
            }
        }
        System.out.printf("你赢了%d局，输了%d局，平了%d局\n",people,compute,5-people-compute);
        if(people > compute){
            System.out.println("玩家获胜！！！！！！！！！！");
        }
        else if(people < compute){
            System.out.println("电脑获胜！！！！！！！！！");
        }
        else{
            System.out.println("平局！");
        }
        //第4题


    }
}